<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>任务详情</title>
        <link rel="stylesheet" href="css/reset.css" />
        <link rel="stylesheet" href="css/platform.css" />
        <link rel="stylesheet" href="css/table.css" />
        <link rel="stylesheet" href="js/magicsuggest-min.css" />
        <link rel="stylesheet" href="css/task-manage.css" />
    </head>

    <body>
        <div class="header">
            <div class="u-title">任务详情</div>
        </div>
        <div class="task-manage" ms-controller="mainController">
            <div class="u-tabs">
                    <div class="tab-box">
                        <div class="tab sel">已分配</div>
                        <div class="tab">未分配</div>
                        <div class="tab">指定分配维护</div>
                    </div>
                    <div class="cnt-box">
                        <div class="cnt">
                            <div class="u-multiform search-param">
                                <div class="column">
                                    <div class="cell">
                                        <label><span>*</span>大区：</label>
                                        <div class="cnt-box">
                                            <input id="magicRegion"  style="width:250px;" type="text"/>
                                        </div>
                                    </div>
                                    <div class="cell">
                                        <label>分公司：</label>
                                        <div class="cnt-box">
                                            <input id="magicBranch"  style="width:250px;" type="text"/>
                                        </div>
                                    </div>
                                </div>
                                <div class="column">
                                	<div class="cell">
                                        <label>门店：</label>
                                        <div class="cnt-box">
                                            <input id="magicStore"  style="width:250px;" type="text"/>
                                        </div>
                                    </div>
                                    <div class="cell">
                                        <label>品类：</label>
                                        <div class="cnt-box">
                                            <select ms-duplex="taskCategory" ms-change="searchBrandByCate">
                                                <option ms-repeat-category="categoryList" ms-attr-value="category.categoryCode">{{category.categoryName}}</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                
                                <div class="column">
                                    <div class="cell">
                                        <label>品牌：</label>
                                        <div class="cnt-box">
                                            <select ms-duplex="taskBrand">
                                                <option ms-repeat-brand="brandList" ms-attr-value="brand.brandCode">{{brand.brandName}}</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="cell">
                                        <label>状态：</label>
                                        <div class="cnt-box">
                                            <select ms-duplex="taskStatus">
                                                <option value="">全部</option>
                                                <option value="0">未盘点</option>
                                                <option value="1">已提交</option>
                                                <option value="2">已结束</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="column">
                                    <div class="cell">
                                        <label> </label>
                                        <div class="cnt-box">
                                            <button class="u-btn small" style="margin-left: 0;" ms-click="search" ms-class="dis:!regionCode">查询</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="export">
                                <button class="u-btn small" ms-click="exportPop()" ms-class="dis:dataLen==0">导出</button>    
                            </div>
                            <div id="taskTable" ms-controller="taskTable"></div>
                            <script type="avalon" id="tableTask">
                                <div class="tableWrapper">
                                    <table class="table">
                                        <thead>
                                            <tr>
                                                <th>大区</th>
                                                <th>公司</th>
                                                <th>门店</th>
                                                <!--<th>任务类型</th>-->
                                                <th>品类</th>
                                                <th>品牌</th>
                                                <th>盘点人</th>
                                                <th>盘点状态</th>
                                                <th>盘点时间</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ms-repeat-row="sources">
                                                <td>{{row.regionName}}</td>
                                                <td>{{row.branchName}}</td>
                                                <td>{{row.storeName}}</td>
                                                <!--<td>{{row.taskType==1?"盘点":"簇维护"}}</td>-->
                                                <td>{{row.categoryName}}</td>
                                                <td>{{row.brandName}}</td>
                                                <td>{{row.inventoryPerson}}</td>
                                                <td>{{row.inventoryStatus | inventoryStatus}}</td>
                                                <td>{{row.inventoryTime==""?"--":row.inventoryTime}}</td>
                                            </tr>
                                        </tbody>
                                        <tfoot>
                                            <tr>
                                                <td colspan="8">
                                                    <div class="pager">
                                                        <div class="first-page" ms-click="firstpage" ms-class={{firstpagestyle}}>首页</div>
                                                        <div class="pre-page" ms-click="prepage" ms-class={{prepagestyle}}>上一页</div>
                                                        <div class="current-page">
                                                            第<input class="current-page-num" type="text" ms-duplex="currentpage" ms-input="jumppage" />页
                                                            <span class="totalpage">共 {{totalpage}} 页</span>
                                                        </div>
                                                        <div class="next-page" ms-click="nextpage" ms-class={{nextpagestyle}}>下一页</div>
                                                        <div class="last-page" ms-click="lastpage" ms-class={{lastpagestyle}}>尾页</div>
                                                        <div class="messageinfo">{{startrow}}-{{endrow}} 共{{total}}条</div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </tfoot>
                                    </table>
                                </div>
                            </script>
                        </div>
                        <div class="cnt" style="display: none;">
                            <div class="u-multiform search-param">
                                <div class="column">
                                    <div class="cell">
                                        <label><span>*</span>大区：</label>
                                        <div class="cnt-box">
                                            <input id="magicRegion2"  style="width:250px;" type="text"/>
                                        </div>
                                    </div>
                                    <div class="cell">
                                        <label>分公司：</label>
                                        <div class="cnt-box">
                                            <input id="magicBranch2"  style="width:250px;" type="text"/>
                                        </div>
                                    </div>
                                </div>
                                <div class="column">
                                	<div class="cell">
                                        <label>门店：</label>
                                        <div class="cnt-box">
                                            <input id="magicStore2"  style="width:250px;" type="text"/>
                                        </div>
                                    </div>
                                    <div class="cell">
                                        <label>品类：</label>
                                        <div class="cnt-box">
                                            <select ms-duplex="taskCategory2">
                                                 <option ms-repeat-category="categoryList" ms-attr-value="category.categoryCode">{{category.categoryName}}</option>
                                            </select>
                                        </div>
                                        <button class="u-btn small" ms-click="search(2)" ms-class="dis:!regionCode2">查询</button>
                                    </div>
                                </div>
                                <div class="column">
                                    <!--<div class="cell">
                                        <label>品牌：</label>
                                        <div class="cnt-box">
                                            <select ms-duplex="taskBrand2">
                                                <option ms-repeat-brand="brandList2" ms-attr-value="brand.brandCode">{{brand.brandName}}</option>
                                            </select>
                                        </div>
                                        <button class="u-btn small" ms-click="search(2)" ms-class="dis:!regionCode2">查询</button>
                                    </div>-->
                                </div>
                            </div>
                            <div class="export">
                                <button class="u-btn small" ms-click="exportPop(2)" ms-class="dis:dataLen2==0">导出</button>    
                            </div>
                            <div id="taskTable2" ms-controller="taskTable2"></div>
                            <script type="avalon" id="tableTask2">
                                <div class="tableWrapper">
                                    <table class="table">
                                        <thead>
                                            <tr>
                                                <th>大区</th>
                                                <th>公司</th>
                                                <th>门店</th>
                                                <!--<th>任务类型</th>-->
                                                <th>品类</th>
                                                <th>分配人</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ms-repeat-row="sources">
                                                <td>{{row.regionName}}</td>
                                                <td>{{row.branchName}}</td>
                                                <td>{{row.storeName}}</td>
                                                <td>{{row.categoryName}}</td>
                                                <td>{{row.assignPerson}}</td>
                                                <td>
                                                    <a href="javascript:;" ms-click="customFuncs.unallocated(row)">未分配品牌</a>
                                                </td>
                                            </tr>
                                        </tbody>
                                        <tfoot>
                                            <tr>
                                                <td colspan="6">
                                                    <div class="pager">
                                                        <div class="first-page" ms-click="firstpage" ms-class={{firstpagestyle}}>首页</div>
                                                        <div class="pre-page" ms-click="prepage" ms-class={{prepagestyle}}>上一页</div>
                                                        <div class="current-page">
                                                            第<input class="current-page-num" type="text" ms-duplex="currentpage" ms-input="jumppage" />页
                                                            <span class="totalpage">共 {{totalpage}} 页</span>
                                                        </div>
                                                        <div class="next-page" ms-click="nextpage" ms-class={{nextpagestyle}}>下一页</div>
                                                        <div class="last-page" ms-click="lastpage" ms-class={{lastpagestyle}}>尾页</div>
                                                        <div class="messageinfo">{{startrow}}-{{endrow}} 共{{total}}条</div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </tfoot>
                                    </table>
                                </div>
                            </script>
                        </div>
                        <div class="cnt" style="display: none;">
                            <div class="u-multiform search-param">
                                <div class="column">
                                    <div class="cell">
				                        <label>任务搜索：</label>
				                        <div class="cnt-box">
				                            <input class="u-ipt" placeholder="请输入员工号" maxlength="10" ms-duplex="staffId" />
				                        </div>
				                        <button class="u-btn small" ms-click="search(3)" >查询</button>
				                    </div>
                                </div>
                            </div>
                            <div id="taskTable3" ms-controller="taskTable3"></div>
                            <script type="avalon" id="tableTask3">
                                <div class="tableWrapper">
                                    <table class="table">
                                        <thead>
                                            <tr>
                                                <th>任务ID</th>
                                                <th>大区</th>
                                                <th>公司</th>
                                                <th>门店</th>
                                                <th>品类</th>
                                                <th>分配人</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ms-repeat-row="sources">
                                                <td>{{row.taskId}}</td>
                                                <td>{{row.regionName}}</td>
                                                <td>{{row.branchName}}</td>
                                                <td>{{row.storeName}}</td>
                                                <td>{{row.categoryName}}</td>
                                                <td>{{row.assignPerson}}</td>
                                                <td>
                                                    <a href="javascript:;" ms-click="customFuncs.clearStaff(row)">清空指定</a>
                                                </td>
                                            </tr>
                                        </tbody>
                                        <tfoot>
                                            <tr>
                                                <td colspan="7">
                                                    <div class="pager">
                                                        <div class="first-page" ms-click="firstpage" ms-class={{firstpagestyle}}>首页</div>
                                                        <div class="pre-page" ms-click="prepage" ms-class={{prepagestyle}}>上一页</div>
                                                        <div class="current-page">
                                                            第<input class="current-page-num" type="text" ms-duplex="currentpage" ms-input="jumppage" />页
                                                            <span class="totalpage">共 {{totalpage}} 页</span>
                                                        </div>
                                                        <div class="next-page" ms-click="nextpage" ms-class={{nextpagestyle}}>下一页</div>
                                                        <div class="last-page" ms-click="lastpage" ms-class={{lastpagestyle}}>尾页</div>
                                                        <div class="messageinfo">{{startrow}}-{{endrow}} 共{{total}}条</div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </tfoot>
                                    </table>
                                </div>
                            </script>
                        </div>
                    </div>
            </div>
            
            
            <button class="u-btn gray return" ms-click="returnManage()">返回</button>
        </div>
        <!--弹框区域-->
        <div ms-controller="popController">
            <div class="u-popup export-pop" id="popup_cnt">
                <div class="bg"></div>
                <div class="asTable-box">
                    <div class="asTable">
                        <div class="asTableCell">
                            <div class="asCell dialog">
                                <a href="javascript:;" class="close btn-close">×</a>
                                <p class="title">选择导出</p>
                                <div class="container">
                                    <div ms-repeat-number="exportCountList" class="e-number" ms-class="sel:$index==0" ms-click="selCount()">
                                        <img src="css/images/export-icon.png">
                                        <p>{{number}}</p>
                                        <div class="sel-icon"></div>
                                    </div>
                                </div>
                                <div class="btn-box">
                                    <button class="u-btn" ms-click="exportList()">确定</button>
                                    <button class="u-btn gray btn-close">取消</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-popup export-pop" id="popup_info">
                <div class="bg"></div>
                <div class="asTable-box">
                    <div class="asTable">
                        <div class="asTableCell">
                            <div class="asCell dialog">
                                <a href="javascript:;" class="close btn-close">×</a>
                                <p class="title">未分配明细</p>
                                <div class="container">
                                    <!--<div class="u-multiform">
                                        <div class="column">
                                            <label>任务：</label>
                                            <div class="cnt-box">这是任务</div>
                                        </div>
                                        <div class="column">
                                            <label>门店：</label>
                                            <div class="cnt-box">门店</div>
                                        </div>
                                        <div class="column">
                                            <label>品牌：</label>
                                            <div class="cnt-box">未分配的品牌</div>
                                        </div>
                                    </div>-->
                                    <p>{{info.brandNames}}</p>
                                </div>
                                <div class="btn-box">
                                    <button class="u-btn btn-close">确定</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-popup" id="popup_tips">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">提示</p>
                            <div class="container">
                                <!--<div class="error"></div>-->
                                <p>该品类/品牌暂未分配</p>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn btn-close">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-popup" id="popup_confirm">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">提示</p>
                            <div class="container">
                                <div class="warning"></div>
                                <p>确定要清除指定督导数据吗？</p>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn" ms-click="confirmSure()">确定</button>
                                <button class="u-btn gray btn-close">取消</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="loadData"></div>
        <script src="js/jquery.min.js"></script>
        <script src="js/avalon.shim.sn.js"></script>
        <script src="js/swift-ui-table-1.1.js"></script>
        <script src="js/magicsuggest-min.js"></script>
        <script src="js/DataInterface/DataInterface.js"></script>
        <script src="js/platform.js"></script>
        <script src="js/undistributed-task.js"></script>
    </body>

</html>
